{include file='filepage/base/header' /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-3">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <div class="file-manager">
                        <h5>显示：</h5>
                        <a href="file_manager.html#" class="file-control active">所有</a>
                        <a href="file_manager.html#" class="file-control">文档</a>
                        <a href="file_manager.html#" class="file-control">视频</a>
                        <a href="file_manager.html#" class="file-control">图片</a>
                        <div class="hr-line-dashed"></div>
                        <form action="file.html?dir={$dir}" method="post">
                            <input type="text" class="form-control" name="floder">
                            <span class="help-block m-b-none">请不要包含特殊符号和中文 </span>
                            <button class="btn btn-primary btn-block">创建文件夹</button>
                        </form>
                        <button class="btn btn-info btn-block" id="upload">上传文件</button>
                        <div class="hr-line-dashed"></div>
                        <h5>文件夹</h5>
                        <ul class="folder-list" style="padding: 0">
                            <!--                            文件夹-->
                            {if $upper!=''}
                            <li><a href="file.html?dir={$upper}"><i class="fa fa-folder"></i>上一级文件夹</a>
                            </li>
                            {/if}
                            {volist name='floder' id='floder'}
                            <li><a href="file.html?dir={$floder.url}"><i class="fa fa-folder"></i>{$floder.name}</a>
                            </li>
                            {/volist}
                            <!--                            -->
                        </ul>
                        {if $desc}
                        <h5 class="tag-title">标签</h5>
                        <ul class="tag-list" style="padding: 0">
                            <!--                            标签-->{if $desc!=''}
                            <li><a href="file_manager.html">{$desc}</a>
                            </li>
                            {else/}
                            <li><a href="file_manager.html">无</a>
                            </li>
                            {/if}
                            <!--                            -->
                        </ul>
                        {/if}
                        <div class="clearfix"></div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-9 animated fadeInRight">
            <div class="row">
                <div class="col-sm-12">
                    {volist id='file' name='file'}
                    <div class="file-box">
                        <a href="{$domain}/{$file.url}{$file.name}">
                            <div class="file">
                                <span class="corner"></span>
                                {switch name="file.type"}
                                {case value="gif|png|jpeg|jpg|bmp"}
                                <div class="image">
                                    <img alt="image" class="img-responsive" src="{$domain}/{$file.url}{$file.name}">
                                </div>
                                {/case}
                                {case value="xlsx|xls"}
                                <div class="icon">
                                    <i class="fa fa-bar-chart-o"></i>
                                </div>
                                {/case}
                                {case value="ppt|pptx"}
                                <div class="icon">
                                    <i class="fa fa-file-powerpoint-o"></i>
                                </div>
                                {/case}
                                {case value="doc|docx"}
                                <div class="icon">
                                    <i class="fa fa-file-word-o"></i>
                                </div>
                                {/case}
                                {case value="c|cpp|py|css|js|java|html"}
                                <div class="icon">
                                    <i class="fa fa-file-code-o"></i>
                                </div>
                                {/case}
                                {case value="txt|pdf|mobi|equb"}
                                <div class="icon">
                                    <i class="fa fa-book"></i>
                                </div>
                                {/case}
                                {case value="sql|db"}
                                <div class="icon">
                                    <i class="fa fa-database"></i>
                                </div>
                                {/case}
                                {case value="mp4|avi|wmv|rmvb|rm"}
                                <div class="icon">
                                    <i class="fa fa-film"></i>
                                </div>
                                {/case}
                                {case value="zip|rar|7z|gar|gz|tar"}
                                <div class="icon">
                                    <i class="fa fa-file-zip-o"></i>
                                </div>
                                {/case}
                                {case value="mp3|midi|wma|flav"}
                                <div class="icon">
                                    <i class="fa fa-music"></i>
                                </div>
                                {/case}
                                {default}
                                <div class="icon">
                                    <i class="fa fa-file"></i>
                                </div>
                                {/switch}
                                <!--                                <div class="icon">-->
                                <!--                                    <i class="fa fa-bar-chart-o"></i>-->
                                <!--                                </div>-->
                                <div class="file-name">
                                    {$file.name}
                                    <br/>
                                    <small>添加时间：{$file.creat_time}</small>
                                </div>
                            </div>
                        </a>
                    </div>
                    {/volist}
                </div>
            </div>
        </div>
    </div>
</div>
</body>


{include file='filepage/base/footer' /}
<script src="__PUBLIC__/home/js/layui/layui.all.js"></script>
<script>
    var $upload = $('#upload');
    $upload.on('click', function () {
        layer.open({
            type: 2,
            title: '上传文件到当前文件夹',
            shadeClose: false,
            shade: 0.8,
            area: ['90%', '90%'],
            content: 'upload_file.html',
            end: function () {
                location.reload();
            }
        })
    });
</script>
